package jee.boot.module.bpm.table;

import jee.boot.module.bpm.dao.MysqlTableOperatorDao;
import jee.boot.module.bpm.table.mysql.MysqlTableExecutor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class TableExecutorConfig {
    /**
     * 配置默认的数据库操作类
     *
     * @return
     */
    @Bean
    @ConditionalOnMissingBean(TableExecutor.class)
    public TableExecutor tableOperator(@Autowired MysqlTableOperatorDao mysqlTableOperatorDao) {
        MysqlTableExecutor operator = new MysqlTableExecutor(mysqlTableOperatorDao);
        return operator;
    }
}
